home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
c_text.zip
/
DRAW_S_B.ASM
< prev
next >
Wrap
Assembly Source File
|
1987-06-23
|
3KB
|
124 lines
;--------------------------------------------------------------------------;
; Draw_box(x,y,width,height,color) - All integers. Draws a WIDTH by HEIGHT ;
; box with the upper left corner at (x,y). COLOR is the color attribute. ;
;--------------------------------------------------------------------------;
URIGHT EQU 191
ULEFT EQU 218
LRIGHT EQU 217
LLEFT EQU 192
HORIZONTAL EQU 196
VERTICAL EQU 179
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT
PUBLIC _DRAW_S_BOX
_DRAW_S_BOX PROC NEAR
PUSH BP
MOV BP,SP
PUSH DI
PUSH SI
PUSH DS
PUSH ES
MOV BL,[BP+12] ;Color attribute
MOV DH,[BP+4] ;X
MOV DL,[BP+6] ;Y
CALL GOTO_YZ
MOV AL,ULEFT
MOV CX,1 ;Print 1 character
CALL PRINT_CH
INC DL ;Next column over
CALL GOTO_YZ
MOV CX,[BP+8] ;Width
SUB CX,2 ;corner + width-2 horizontal + corner
MOV AL,HORIZONTAL ; equals WIDTH
CALL PRINT_CH
MOV DL,[BP+8]
ADD DL,[BP+6]
DEC DL
CALL GOTO_YZ
MOV CX,1
MOV AL,URIGHT
CALL PRINT_CH
MOV CX,[BP+10]
SUB CX,2
MOV AL,VERTICAL
DRAW_VERT:
PUSH CX
MOV CX,1
INC DH
MOV DL,[BP+6]
CALL GOTO_YZ
CALL PRINT_CH
ADD DL,[BP+8]
DEC DL
CALL GOTO_YZ
CALL PRINT_CH
POP CX
LOOP DRAW_VERT
INC DH
MOV DL,[BP+6]
CALL GOTO_YZ
MOV AL,LLEFT
MOV CX,1
CALL PRINT_CH
INC DL
CALL GOTO_YZ
MOV CX,[BP+8]
SUB CX,2
MOV AL,HORIZONTAL
CALL PRINT_CH
ADD DL,[BP+8]
SUB DL,2
CALL GOTO_YZ
MOV CX,1
MOV AL,LRIGHT
CALL PRINT_CH
POP ES
POP DS
POP SI
POP DI
POP BP
RET
_DRAW_S_BOX ENDP
PUBLIC PRINT_CH
PRINT_CH PROC NEAR
PUSH AX
PUSH BX
MOV AH,9 ;Service 9, print character
MOV BH,0 ;Display page 0
INT 10h
POP BX
POP AX
RET
PRINT_CH ENDP
PUBLIC GOTO_YZ
GOTO_YZ PROC NEAR
PUSH AX
PUSH BX
MOV AH,2 ;Service 2, Move cursor
XOR BH,BH ;Page 0
INT 10h
POP BX
POP AX
RET
GOTO_YZ ENDP
_TEXT ENDS
END